from generic.object import Object

class TidalTrackStream(Object):
  def set_raw_data(self, raw_data):
    self.set_values(
      track_id = raw_data["trackId"],
      quality = raw_data["soundQuality"],
      url = raw_data["url"],
      codec = raw_data["codec"]
    )

  def set_values(
    self,
    track_id = None,
    quality = None,
    url = None,
    codec = None,
    raw_data = None
  ):
    if raw_data != None:
      self.set_raw_data(raw_data)
      return
    self.track_id = track_id
    self.quality = quality
    self.url = url
    self.codec = codec
